/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_diagnostico")
@NamedQueries({
    @NamedQuery(name = "CexDiagnostico.findAll", query = "SELECT c FROM CexDiagnostico c")})
public class CexDiagnostico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cdi_id")
    private Integer cdiId;
    @Basic(optional = false)
    @Column(name = "cdi_codigo")
    private String cdiCodigo;
    @Basic(optional = false)
    @Column(name = "cdi_nombre")
    private String cdiNombre;
    @Column(name = "cdi_sexo")
    private Integer cdiSexo;
    @Column(name = "cdi_limite_inferior")
    private Integer cdiLimiteInferior;
    @Column(name = "cdi_limite_superior")
    private Integer cdiLimiteSuperior;
    @OneToMany(mappedBy = "cexDiagnostico", fetch = FetchType.LAZY)
    private List<CexDiagnosticoConsulta> cexDiagnosticoConsultaList;

    public CexDiagnostico() {
    }

    public CexDiagnostico(Integer cdiId) {
        this.cdiId = cdiId;
    }

    public CexDiagnostico(Integer cdiId, String cdiCodigo, String cdiNombre) {
        this.cdiId = cdiId;
        this.cdiCodigo = cdiCodigo;
        this.cdiNombre = cdiNombre;
    }

    public Integer getCdiId() {
        return cdiId;
    }

    public void setCdiId(Integer cdiId) {
        this.cdiId = cdiId;
    }

    public String getCdiCodigo() {
        return cdiCodigo;
    }

    public void setCdiCodigo(String cdiCodigo) {
        this.cdiCodigo = cdiCodigo;
    }

    public String getCdiNombre() {
        return cdiNombre;
    }

    public void setCdiNombre(String cdiNombre) {
        this.cdiNombre = cdiNombre;
    }

    public Integer getCdiSexo() {
        return cdiSexo;
    }

    public void setCdiSexo(Integer cdiSexo) {
        this.cdiSexo = cdiSexo;
    }

    public Integer getCdiLimiteInferior() {
        return cdiLimiteInferior;
    }

    public void setCdiLimiteInferior(Integer cdiLimiteInferior) {
        this.cdiLimiteInferior = cdiLimiteInferior;
    }

    public Integer getCdiLimiteSuperior() {
        return cdiLimiteSuperior;
    }

    public void setCdiLimiteSuperior(Integer cdiLimiteSuperior) {
        this.cdiLimiteSuperior = cdiLimiteSuperior;
    }

    public List<CexDiagnosticoConsulta> getCexDiagnosticoConsultaList() {
        return cexDiagnosticoConsultaList;
    }

    public void setCexDiagnosticoConsultaList(List<CexDiagnosticoConsulta> cexDiagnosticoConsultaList) {
        this.cexDiagnosticoConsultaList = cexDiagnosticoConsultaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdiId != null ? cdiId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexDiagnostico)) {
            return false;
        }
        CexDiagnostico other = (CexDiagnostico) object;
        if ((this.cdiId == null && other.cdiId != null) || (this.cdiId != null && !this.cdiId.equals(other.cdiId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.CexDiagnostico[ cdiId=" + cdiId + " ]";
    }
    
}
